﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Refund.aspx.cs" Inherits="WL_Store.Web.subpage.Refund" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../css/style.css"/>       
        <link href="../assets/css/codemirror.css" rel="stylesheet"/>
        <link rel="stylesheet" href="../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="../js/jquery-1.9.1.min.js"></script>
		<script src="../js/H-ui.js" type="text/javascript"></script>  
        <script src="../assets/js/bootstrap.min.js"></script>
		<script src="../assets/js/typeahead-bs2.min.js"></script>           	
		<script src="../assets/js/jquery.dataTables.min.js"></script>
		<script src="../assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="../assets/layer/layer.js" type="text/javascript" ></script>          
        <script src="../assets/laydate/laydate.js" type="text/javascript"></script>
          
        <script src="../js/lrtk.js" type="text/javascript" ></script>
    <script src="../My97DatePicker/WdatePicker.js"></script>
<title>退款管理</title>
    <style>
        th {
            text-align: center;
        }

        .add_name span {
            color: red;
        }
        td{
        padding:4px;
        text-align:center;
        }
        #gv_AllAdminInfo tr {
        height:40px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="margin clearfix">
 <div id="refund_style">
   <div class="search_style">
     
      <ul class="search_content clearfix">
       <li><label class="l_f">产品名称</label>
           <input id="txt_comName" runat="server" name="" type="text" class="text_add" placeholder="输入商品名称" style=" width:200px"/>

       </li>
       <li><label class="l_f">交易时间</label>
           <input class="inline laydate-icon"  runat="server" id="txt_StarttradingHour" style=" margin-left:10px;" onclick="WdatePicker({ isShowClear: true, readOnly: true })"/>
           <label >至</label>
                <input class="inline laydate-icon" runat="server" id="txt_EndtradingHour" style=" margin-left:10px;" onclick="WdatePicker({ isShowClear: true, readOnly: true })"/>
       </li>
          <li><label class="l_f">商品类别</label>
              <asp:DropDownList ID="ddl_category" runat="server" style=" margin-left:10px;"  ></asp:DropDownList>
          </li>
           <li><label class="l_f">退款状态</label>
               <asp:RadioButtonList ID="rbl_state" runat="server" RepeatDirection="Horizontal" style="line-height:1">
                    <asp:ListItem Value="1">未退款</asp:ListItem>
                  <asp:ListItem Value="0">已退款</asp:ListItem>
                  <asp:ListItem Value="-1" Selected="True">不限</asp:ListItem>
               </asp:RadioButtonList>
          </li>
       <li style="width:90px;">
           <%--<button id="btn_search" runat="server" type="button" class="btn_search" OnClick="btn_search_Click"><i class="fa fa-search"></i>查询</button>--%>
           <asp:Button ID="btn_searchs" runat="server" Text="查询" OnClick="btn_search_Click" CausesValidation="false"  class="btn_search"/>
          
       </li>
      </ul>
    </div>
 <div class="border clearfix">
       <span class="l_f">
        <a href="javascript:ovid()" id="Refund_add" class="btn btn-warning "><i class="fa fa-plus "></i>添加退款信息</a>
        <a href="javascript:ovid()" class="btn btn-success Order_form"><i class="fa fa-check-square-o"></i>&nbsp;已退款订单</a>
        <a href="javascript:ovid()" class="btn btn-warning Order_form"><i class="fa fa-close"></i>&nbsp;未退款订单</a>
        <a href="javascript:ovid()" class="btn btn-danger"><i class="fa fa-trash"></i>&nbsp;批量删除</a>
       </span>
       <span class="r_f">共：<b>2334</b>笔</span>
     </div>
     <!--退款列表-->
   <%--  <asp:GridView ID="gv_refund" runat="server" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" AutoGenerateColumns="False" Width="1200px">
         <Columns>
             <asp:BoundField DataField="orderID" HeaderText="订单编号" />
             <asp:BoundField DataField="commodityId" HeaderText="商品Id" />
             <asp:BoundField DataField="comName" HeaderText="商品名称" />
             <asp:BoundField DataField="category" HeaderText="商品类别" />
             <asp:BoundField DataField="transactionAmount" HeaderText="交易金额" />
             <asp:BoundField DataField="tradingHour" HeaderText="交易时间" />
             <asp:BoundField DataField="refundMoney" HeaderText="退款金额" />
             <asp:BoundField DataField="refundAmount" HeaderText="退款数量" />
             <asp:BoundField DataField="stateString" HeaderText="退款状态" />
             <asp:BoundField DataField="explain" HeaderText="说明" />
             <asp:BoundField DataField="isDeleteString" HeaderText="是否删除" />
             <asp:TemplateField HeaderText="操作">
                 <ItemTemplate>
                     <asp:LinkButton ID="lbt_del" runat="server" CommandName="del" OnCommand="lbt_delete_Command" CommandArgument='<%# Eval("orderID") %>'  class="btn btn-warning" OnClientClick="return confirm('你确定要删除吗？')">删除</asp:LinkButton>
                    <a href='Refund_edit.aspx?orderID=<%# Eval("orderID") %> ' class="btn btn-warning">编辑</a>
                 </ItemTemplate>
             </asp:TemplateField>
         </Columns>
         <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
         <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
         <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
         <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
         <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
         <SortedAscendingCellStyle BackColor="#F1F1F1" />
         <SortedAscendingHeaderStyle BackColor="#594B9C" />
         <SortedDescendingCellStyle BackColor="#CAC9C9" />
         <SortedDescendingHeaderStyle BackColor="#33276A" />

     </asp:GridView>--%>

     <table class="table table-striped table-bordered table-hover dataTable no-footer">
         <tr>
             <th>订单编号</th>
              <th>商品Id</th>
              <th>商品名称</th>
              <th>商品类别</th>
              <th>交易金额</th>
              <th>交易时间</th>
              <th>退款金额</th>
              <th>退款数量</th>
              <th>退款状态</th>
              <th>说明</th>
              <th>是否删除</th>
              <th style="width:140px">操作</th>
         </tr>
         <asp:Repeater ID="rpt_refund" runat="server">
             <ItemTemplate>
                 <tr>
                     <td><%# Eval("orderID") %></td>
                     <td><%# Eval("commodityId") %></td>
                     <td><%# Eval("comName") %></td>
                     <td><%# Eval("category") %></td>
                     <td><%# Eval("transactionAmount") %></td>
                     <td><%# Eval("tradingHour") %></td>
                     <td><%# Eval("refundMoney") %></td>
                     <td><%# Eval("refundAmount") %></td>
                     <td><%# Eval("stateString") %></td>
                     <td><%# Eval("explain") %></td>
                     <td><%# Eval("isDeleteString") %></td>
                     <td>
                         <a href='Refund_edit.aspx?orderID=<%# Eval("orderID") %> ' class="edit btn btn-sm btn-success" style="float:left"> 编辑</a>
                         <asp:LinkButton ID="lbt_del" CssClass="del btn btn-sm btn-danger" CausesValidation="false"  runat="server" CommandName="del" OnCommand="lbt_delete_Command" CommandArgument='<%# Eval("orderID") %>'  class="btn btn-warning" OnClientClick="return confirm('你确定要删除吗？')" Visible=' <%# Convert.ToBoolean(Eval("isDelete"))?false:true %>'> 删除</asp:LinkButton>
                    
              
                     </td>
                 </tr>
             </ItemTemplate>

         </asp:Repeater>

     </table>




      <!--添加退款信息-->
            <div id="add_refund" class="add_menber" style="display: none">

                <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>订单编号：</label>
                    <div class="formControls">
                        <%--<input type="text" class="input-text" value="" placeholder="" id="user-name" name="user-name" datatype="*2-16" nullmsg="用户名不能为空">--%>
                        <asp:TextBox ID="txt_add_orderID" runat="server" placeholder="订单编号" ></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="订单编号不能为空" ControlToValidate="txt_add_orderID"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>商品Id：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <asp:TextBox ID="txt_add_commodityId" runat="server" placeholder="商品Id"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="商品Id不能为空" ControlToValidate="txt_add_commodityId"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>商品名称：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <asp:TextBox ID="txt_add_comName" runat="server" placeholder="商品名称"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="商品名称不能为空" ControlToValidate="txt_add_comName"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>商品类别：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                         <asp:DropDownList ID="ddl_add_categoryId" runat="server" style=" margin-left:10px;" ></asp:DropDownList>
                    
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>交易金额：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <asp:TextBox ID="txt_add_transactionAmount" runat="server" placeholder="交易金额"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ErrorMessage="交易金额不能为空" ControlToValidate="txt_add_transactionAmount"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>交易时间：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <input class="inline laydate-icon"  runat="server" id="txt_add_tradingHour" style=" margin-left:10px;" onclick="WdatePicker({ isShowClear: true, readOnly: true })"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="交易时间不能为空" ControlToValidate="txt_add_tradingHour"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>退款金额：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <asp:TextBox ID="txt_add_refundMoney" runat="server" placeholder="退款金额"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="退款金额不能为空" ControlToValidate="txt_add_refundMoney"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 <div class="form-group">
                    <label class="form-label"><span class="c-red">*</span>退款数量：</label>
                    <div class="formControls">
                        <%--<input type="password" placeholder="密码" name="userpassword" autocomplete="off" value="" class="input-text" datatype="*6-20" nullmsg="密码不能为空">--%>
                        <asp:TextBox ID="txt_add_refundAmount" runat="server" placeholder="退款数量"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ErrorMessage="退款数量不能为空" ControlToValidate="txt_add_refundAmount"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                 
                <div class="form-group">
                    <label class="form-label "><span class="c-red">*</span>退款状态：</label>
                    <div class="formControls  skin-minimal">
                        <asp:RadioButtonList ID="rbt_add_state" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="0">未退款</asp:ListItem>
                            <asp:ListItem Value="1">已退款</asp:ListItem>

                        </asp:RadioButtonList>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                <div class="form-group">
                    <label class="form-label "><span class="c-red">*</span>说明：</label>
                    <div class="formControls ">
                        <%--<input type="text" class="input-text" value="" placeholder="" id="user-tel" name="user-tel" datatype="m" nullmsg="手机不能为空"/>--%>
                        <asp:TextBox ID="txt_add_explain" runat="server" placeholder="说明"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="说明不能为空" ControlToValidate="txt_add_explain"></asp:RequiredFieldValidator>
                    </div>
                    <div class="col-4"><span class="Validform_checktip"></span></div>
                </div>
                
                    <%--<input class="btn btn-primary radius" type="submit" id="Add_Administrator" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"/>--%>
                    <asp:Button ID="btn_add" runat="server" Text="添加" class="btn btn-primary radius" OnClick="btn_add_Click" />
                </div>

            

 </div>
</div>
    </form>
</body>
</html>
<script>
 //订单列表
jQuery(function($) {
		var oTable1 = $('#sample-table').dataTable( {
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3,4,5,6,8,9]}// 制定列不参与排序
		] } );
                 //全选操作
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			});
function Delivery_Refund(obj,id){
			
			 layer.confirm('是否退款当前商品价格！',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style=" display:none" class="btn btn-xs btn-success" onClick="member_stop(this,id)" href="javascript:;" title="已退款">退款</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt  radius">已退款</span>');
		$(obj).remove();
		layer.msg('已退款!',{icon: 6,time:1000});
			});  
			  
		  
};
//面包屑返回值
var index = parent.layer.getFrameIndex(window.name);
parent.layer.iframeAuto(index);
$('.Refund_detailed').on('click', function(){
	var cname = $(this).attr("title");
	var chref = $(this).attr("href");
	var cnames = parent.$('.Current_page').html();
	var herf = parent.$("#iframe").attr("src");
    parent.$('#parentIframe').html(cname);
    parent.$('#iframe').attr("src",chref).ready();;
	parent.$('#parentIframe').css("display","inline-block");
	parent.$('.Current_page').attr({"name":herf,"href":"javascript:void(0)"}).css({"color":"#4c8fbd","cursor":"pointer"});
	//parent.$('.Current_page').html("<a href='javascript:void(0)' name="+herf+" class='iframeurl'>" + cnames + "</a>");
    parent.layer.close(index);
	
});
    //添加退款信息
    $('#Refund_add').on('click', function () {
        layer.open({ type: 1, title: '添加退款信息', area: ['700px', ''], content: $('#add_refund'), });
        //return false;
    });
</script>

